import torch
import random

class CustomGaussianNoise:
    def __init__(self, min_strength=0.01, max_strength=0.05):
        """
        Initialize the CustomGaussianNoise with a strength parameter.
        """
        self.min_strength = min_strength
        self.max_strength = max_strength

    def __call__(self, x: torch.Tensor) -> torch.Tensor:
        """
        Apply Gaussian Noise to the input tensor.
        
        Args:
        x (torch.Tensor): Input tensor with shape [B, C, H, W] or [C, H, W].
        
        Returns:
        torch.Tensor: Noisy tensor with the same shape as input.
        """
        current_strength = random.uniform(self.min_strength, self.max_strength)
        noise = torch.randn_like(x) * current_strength
        return x + noise
